package com.shr.newcoder;

import java.util.Scanner;

public class NtesGame_1 {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in) ;
		String str = sc.nextLine() ;
		StringBuffer sb = new StringBuffer() ;
		for(int i = 0;i<str.length();i++){
			int count = 1;
			while(i<str.length()-1 && str.charAt(i)==str.charAt(i+1)){
				count++ ;
				i++;
			}
			sb.append(count).append(str.charAt(i)) ;
		}
		System.out.println(sb.toString());
		sc.close();
	}

}
